
//
//  StarsView.m
//  ECBBusinessCamp
//
//  Created by rimi on 16/6/28.
//  Copyright © 2016年 邓毕华. All rights reserved.
//

#import "StarsView.h"

#define STARS_WIDTH SCREEN_WIDTH * 0.02

@implementation StarsView

#pragma mark 🌷🌷🌷life cycle🌷🌷🌷
- (instancetype)initWithLevelInt:(NSInteger)levelInt
{
    self = [super init];
    if (self) {
        for (NSInteger i = 0; i < 5; i++) {
            UIImageView * starImageView = [[UIImageView alloc] initWithFrame:CGRectMake(i * STARS_WIDTH, 0, STARS_WIDTH, STARS_WIDTH)];
            starImageView.image = [UIImage imageNamed:i < levelInt ? @"Course_Rank_1.gif" : @"Course_Rank_0_l.png"];
            [self addSubview:starImageView];
        }
    }
    return self;
}

@end
